import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description: 查找组成一个偶数最接近的两个素数
 * User: 86187
 * Date: 2022-10-23
 * Time: 18:24
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int half = n / 2;
            for (int i = half; i > 0; i--) {
                if (isPrime(i) && isPrime(n - i)) {
                    System.out.println(i);
                    System.out.println(n - i);
                    break;
                }
            }
        }
    }
    //素数的因数是1和它本身
    public static boolean isPrime(int num) {
        for (int i = 2; i * i <= num; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }

}
